import { defineStore } from "pinia"; 

export const useStore = defineStore("essays", {
  state: () => {
    return {
      essay_list: [],
      searchEssayResult: [],
      osTheme: 'light', // 系统主题
      unReadMsg: 0, // 未读消息
    }
  },
  actions: {
    setEssayList(essay_list:object[]) {
      this.essay_list = essay_list as []
    },
    setSearchEssayResult(searchEssayResult:object[]) {
      this.searchEssayResult = searchEssayResult as []
    },
    setOsTheme(osTheme:string) {
      this.osTheme = osTheme
    },
    setUnReadMsg(unReadMsg:number) {
      this.unReadMsg = unReadMsg
    }
  }
})
